﻿Imports System.Web
Imports System.Web.SessionState
Imports Equipment.DataAccess

Public Class Application

    Public Shared ReadOnly Property CurrentUserInfo() As UserInfo
        Get
            Dim session As HttpSessionState = HttpContext.Current.Session
            If session("UserInfo") Is Nothing Then
                session("UserInfo") = New UserInfo()
            End If
            Return DirectCast(session("UserInfo"), UserInfo)
        End Get
    End Property


    Public Shared Sub AuthenticateUser(ByVal user As User)

        Dim session As HttpSessionState = HttpContext.Current.Session
        Dim currInfo As New UserInfo(user)

        session("UserInfo") = currInfo

    End Sub

    Public Shared Sub SignOut()

        Dim session As HttpSessionState = HttpContext.Current.Session
        Dim currInfo As New UserInfo()

        session("UserInfo") = currInfo

    End Sub



End Class
